package com.it;

import java.util.*;
import java.io.*;

public class Solution {
    public static int gcd(int a,int b) {
        return b==0?a:gcd(b, a%b);
    }

    private static void solve() {
        int n ;
        Scanner scanner = new Scanner(System.in);
        n = scanner.nextInt();
        int[] v = new int[n];
        for (int i = 0 ; i < n ;i++){
            v[i] = scanner.nextInt();
        }
        for (int i = 0 ;i < n ;i++){
            for (int j = i + 1; j<n;j++){
                if (gcd(v[i],v[j])<=2){
                    System.out.print("Yes");
                    return;
                }
            }
        }
        System.out.print("No");
    }

    public static void main(String[] args) {
        int n;
        Scanner scanner=new Scanner(System.in);
        n = scanner.nextInt();
        while (n-->0){
            solve();
        }
    }



}

